package com.scalar.chiptrack.users;


public final class FunctionAccess
{

    private int m_FatId = -1;
    private String m_userId = null;
    private int m_groupId = -1;
    private int m_functionId = -1;
    private String m_FunctionName = "";

    private boolean m_viewAllowed = false;
    private boolean m_modifyAllowed = false;
    private boolean m_deleteAllowed = false;

    private boolean m_showView = true; //specifies whether to show the view permission in the user maintainance page for this function
    private boolean m_showModify = true; //specifies whether to show the modify permission in the user maintainance page for this function
    private boolean m_showDelete = true; //specifies whether to show the delete permission in the user maintainance page for this function

    public FunctionAccess()
    {
    }

    public FunctionAccess( String userId, int groupId, int funcId, boolean view, boolean modify, boolean delete )
    {
        m_userId = userId;
        m_groupId = groupId;
        m_functionId = funcId;

        m_viewAllowed = view;
        m_modifyAllowed = modify;
        m_deleteAllowed = delete;
    }

    public int getFatId()
    {
        return m_FatId;
    }

    public void setFatId( int fatId )
    {
        this.m_FatId = fatId;
    }

    public String getUserId()
    {
        return m_userId;
    }

    public void setUserlId( String id )
    {
        m_userId = id;
    }

    public int getGroupId()
    {
        return m_groupId;
    }

    public void setGroupId( int id )
    {
        m_groupId = id;
    }

    public int getFunctionId()
    {
        return m_functionId;
    }

    public void setFunctionId( int id )
    {
        m_functionId = id;
    }

    public String getFunctionName()
    {
        return m_FunctionName;
    }

    public void setFunctionName( String functionName )
    {
        this.m_FunctionName = functionName;
    }

    public boolean getView()
    {
        return m_viewAllowed;
    }

    public void setView( boolean flag )
    {
        m_viewAllowed = flag;
    }

    public boolean getModify()
    {
        return m_modifyAllowed;
    }

    public void setModify( boolean flag )
    {
        m_modifyAllowed = flag;
    }

    public boolean getDelete()
    {
        return m_deleteAllowed;
    }

    public void setDelete( boolean flag )
    {
        m_deleteAllowed = flag;
    }

    public boolean isShowView()
    {
        return m_showView;
    }

    public void setShowView( boolean showView )
    {
        this.m_showView = showView;
    }

    public boolean isShowModify()
    {
        return m_showModify;
    }

    public void setShowModify( boolean showModify )
    {
        this.m_showModify = showModify;
    }

    public boolean isShowDelete()
    {
        return m_showDelete;
    }

    public void setShowDelete( boolean showDelete )
    {
        this.m_showDelete = showDelete;
    }

    public String toString()
    {
        return "userid = " + m_userId + ", groupId = " + m_groupId + ", functionId = " + m_functionId + ", view = " + m_viewAllowed + ", modify = " + m_modifyAllowed + ", delete = " + m_deleteAllowed;
    }
}